package com.htdw.unityx;

import android.app.Activity;
import android.os.Bundle;
import android.os.Vibrator;
import android.content.Intent;
import android.content.Context;
import android.telephony.TelephonyManager;

public class AndroidTool
{
    //获取本机号码
    public static String GetPhoneNumber(Context context)
    {
        TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
        String s  = tm.getLine1Number();//获取本机号码
        return s;
    }

    //手机震动
    public static void Vibrate(Context context, long milliseconds)
    {
        Vibrator vib = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
        vib.vibrate(milliseconds);
	}
    //手机震动
    public static void Vibrate(Context context, long[] pattern, int repeat)
    {
        Vibrator vib = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
        vib.vibrate(pattern, repeat);
	}
}